<template>
  	<el-dialog title="查看订单" :visible.sync="showProcessingLook" width="95%" :before-close="handleClose" center class="look_order">
      <el-row :gutter="24">
				<el-col :span="left_form">
					<div class="grid-content bg-purple">
						<div class="btn_chageAgent btn_chage" v-if="role_id!=2">
							<el-button v-if="role_id==1" type="danger" @click="delOrderFn" v-no-more-click:3000>删除</el-button>

							<el-button v-no-more-click:3000 v-if="status == '处理中'" type="primary" icon="el-icon-edit" @click="chageAgent">变更代理人</el-button>

							<el-button v-no-more-click:3000 v-if="status == '处理中' && form.status != '等待提交国知局'" type="danger" icon="el-icon-edit" @click="closeOrder">结束流程</el-button>

							<el-button v-no-more-click:3000 v-if="status == '待接单'" type="danger" icon="el-icon-edit" @click="distributionAgent(form.id)">分配代理人</el-button>
						</div>
						<el-form :model="form" ref="ruleForm" label-width="120px">
							<el-row type="flex">
								<el-col :span="12">
									<el-form-item label="专利名称：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.patent_name }}</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="专利类型：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.type }}</el-form-item>
								</el-col>
							</el-row>
							<el-row type="flex">
								<el-col :span="12">
									<el-form-item label="订单编号：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.order_number }}</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="订单状态：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.status }}</el-form-item>
								</el-col>
							</el-row>

							<el-row type="flex">
								<el-col :span="12">
									<el-form-item label="专利权人：" v-if="/^(1|4)$/.test(role_id)">{{ form.patent_user }}</el-form-item>
									<!-- <el-form-item label="专利名称：">{{ form.patent_name }}</el-form-item> -->
								</el-col>
								<el-col :span="12">
									<el-form-item label="发明人姓名：" v-if="/^(1|4)$/.test(role_id)">{{ form.user_name }}</el-form-item>
									<!-- <el-form-item label="专利类型：">{{ form.type }}</el-form-item> -->
								</el-col>
							</el-row>

							<el-row v-if="role_id !=2">
								<el-col :span="12">
									<el-form-item label="身份证号：" v-if="/^(1|4)$/.test(role_id)">{{ form.id_card }}</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="联络人：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.liaisons }}</el-form-item>
								</el-col>
							</el-row>
							<el-row type="flex">
								<el-col :span="12">
									<el-form-item label="联络人邮箱：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.liaisons_email }}</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="联络人电话：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.liaisons_tel }}</el-form-item>
								</el-col>
							</el-row>
							<el-row type="flex">
								<el-col :span="12">
									<el-form-item label="代理人：" v-if="/^(1|2|4)$/.test(role_id)">
										<strong>
											<font v-if="form.agent" :color="form.agent.type =='离职'?'red':'green'">{{ order_agent?order_agent.name:'' }}</font>
											<font v-if="!form.agent">{{ order_agent?order_agent.name:'' }}</font>
										</strong>
									</el-form-item>
									<!-- <el-form-item label="申报主体：">{{ form.pattern }}</el-form-item> -->
								</el-col>
								<el-col :span="12">
									<el-form-item label="流程人员：">
										{{order_process.name}}
									</el-form-item>
									<!-- <el-form-item label="延伸服务：">{{ form.service }}</el-form-item> -->
								</el-col>
							</el-row>
							<el-form-item label="技术领域：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.territory }}</el-form-item><!-- v-if="form.territory != null" -->
							<el-form-item label="技术背景：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.background }}</el-form-item><!-- v-if="form.territory != null" -->
							<el-form-item label="技术问题：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.problem }}</el-form-item><!-- v-if="form.territory != null" -->
							<el-form-item label="技术方案：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.plan }}</el-form-item>
							<el-form-item label="项目优势：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.advantage }}</el-form-item>
							<el-form-item label="具体实施方式：" v-if="/^(1|2|4)$/.test(role_id)">{{ form.way }}</el-form-item>
							<!-- label="资料下载：" -->
							<el-row v-if="/^(1|2)$/.test(role_id)">
								<el-col :span="12">
									<el-form-item label="附图：" style="border-bottom-width: 1px;">
										<div v-if="form.img != '' || form.img != null" style="height: 40px;-webkit-display:flex;
											display:flex;
											-webkit-align-items:center;
											align-items:center;">
											<a v-for="item in form.imgArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
												:download="item.path" :title="item.path" class="el-icon-picture-outline file_sh"></a>
										</div>
									</el-form-item>
								</el-col>
								<el-col :span="12">
									<el-form-item label="附件：" style="border-bottom-width: 1px;">
										<div  v-if="form.file != '' || form.file != null" style="height: 40px;-webkit-display:flex;
												display:flex;
												-webkit-align-items:center;
												align-items:center;">
											<a v-for="item in form.fileArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
												:download="item.path" :title="item.path" class="el-icon-tickets file_sh"></a>
										</div>
									</el-form-item>
								</el-col>
							</el-row>
							<!-- 流程状态为【处理中】或【审核未通过】查看功能会有一个[内容审核文件]
              可以上传文件。-->
							<!-- 只有代理人 未上传审核文件或者案件修改 时显示 -->
							<div v-if="role_id == 2 ">
								<el-form-item label="内容审核文件："  v-if="form.status == '代理人撰写中' || form.status == '案件修改中'">
									<div class="upload-demo">
										<span class="tips_1">请直接上传已完成的word文档,单个主体文件,无需分解,仅供内容 审查</span>
										<br />
										<span class="tips_2">* 如果多报或者分案或返修等,请分别上传word文件</span>
										<br />
										<template v-if="form.status == '代理人撰写中'">
											<span class="tips_3">* 多报文件命名格式: 订单编号-代理人姓名-案件名称-案件类型.docx</span>
											<br />
											<span class="tips_3">* 分案文件格式为：订单编号-序号(数字)-代理人姓名-案件名称-案件类型.docx</span>
										</template>
										<template v-if="form.status == '案件修改中'">
											<span class="tips_3">* 多报返修文件格式为：订单编号-代理人姓名-案件名称-案件类型-R(数字).docx</span>
											<br />
											<span class="tips_3">* 分案返修文件格式为：订单编号-序号(数字)-代理人姓名-案件名称-案件类型-R(数字).docx</span>
										</template>
									</div>
									<!-- 内审中 不显示上传按钮，显示文件   修改中显示上传文件 并可上传-->
									<el-form-item v-if="form.status == '案件内审中'" class="file_content1" style="margin-top: -1px;    height: 42px;
										width: 100%;
										-webkit-display: flex;
										display: flex;
										-webkit-align-items: center;
										align-items: center;">
										<a v-for="item in form.reviewfileArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
											:download="item.path" :title="item.path" class="el-icon-tickets file_sh"></a>
									</el-form-item>

									<!-- 上传控件 -->
									<el-upload
										v-if="form.status == '代理人撰写中' || form.status == '案件修改中'"
										class="upload-demo"
										ref="upload"
									 	:auto-upload="true"
										:on-change="handleChange"
										:action="baseUrl + '/api/order/'+ this.form.id +'/upload'"
										:file-list="fileList"
										:http-request="uploadSectionFile"
										:on-remove="handleRemove"
										multiple
										:limit="3">
										<!-- <div slot="tip" class="el-upload__tip">上传文件</div> -->
										<el-button v-no-more-click:3000 slot="trigger" size="small" type="primary">选择文件</el-button>
										<el-button v-no-more-click:3000 style="margin-left: 10px;" size="small" type="success" @click="submitUpload">确认上传</el-button>
									</el-upload>
								</el-form-item>
							</div>

							<!-- 审核员一直只能查看 -->
							<div>
								<el-row>
									<el-col :span="12">
										<el-form-item label="审核文件：" class="file_content1 file" style="border-bottom-width: 1px;">
											<a v-for="item in form.reviewfileArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
												:download="item.path" :title="item.path" class="el-icon-tickets file_sh"></a>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="完成文件：" class="file_content1 file" style="border-bottom-width: 1px;">
											<a v-for="item in form.fishfileArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
												:download="item.path" :title="item.path" class="el-icon-tickets file_sh"></a>
										</el-form-item>
									</el-col>
								</el-row>
								<el-form-item label="完成文件：" class="file_content1" >
									<a v-for="item in form.fishfileArr" :key="item.id" :href="baseUrl + '/api/download?path='  + item.file +'/'+ item.path"
										:download="item.path" :title="item.path" class="el-icon-tickets file_sh"></a>
								</el-form-item>
							</div>
						</el-form>
					</div>
				</el-col>
			</el-row>
  	</el-dialog>
</template>

<script>
export default {
  data () {
    return {
      showProcessingLook: false
    }
  },
  methods: {
    handleClose () {

    }
  }
}
</script>

<style lang='less'>
  .look_order {

  }
</style>
